package com.ruoyi.goods.domain;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.ruoyi.common.core.annotation.Excel;
import com.ruoyi.common.core.web.domain.BaseEntity;

import java.util.List;

/**
 * 商品分类对象 bm_category
 * 
 * @author ruoyi
 * @date 2023-08-03
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
public class BmCategory extends BaseEntity
{
    private static final long serialVersionUID = 1L;

    /** 商品类别id */
    private Long id;

    /** 父分类id */
    @Excel(name = "父分类id")
    private Long parentId;

    /** 排序 */
    @Excel(name = "排序")
    private Long sort;

    /** 分类名称 */
    @Excel(name = "分类名称")
    private String cname;

    /** 分类图标 */
    @Excel(name = "分类图标")
    private String categoryImg;

    /** 备注 */
    @Excel(name = "备注")
    private String mark;

    /** 分类级别 */
    @Excel(name = "分类级别")
    private Long level;

    /** 删除标记 0.未删除 1.已删除 */
    @Excel(name = "删除标记 0.未删除 1.已删除")
    private Long isDeleted;

    private List<BmCategory> child;//子节点集合

    @Override
    public String toString() {
        return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
            .append("id", getId())
            .append("parentId", getParentId())
            .append("sort", getSort())
            .append("cname", getCname())
            .append("categoryImg", getCategoryImg())
            .append("mark", getMark())
            .append("createTime", getCreateTime())
            .append("level", getLevel())
            .append("isDeleted", getIsDeleted())
            .append("child", getChild())
            .toString();
    }
}
